package cn.cheln.support.ui;

import android.app.Activity;
import android.content.Context;
import android.content.res.Resources;
import android.util.DisplayMetrics;
import android.view.Display;
import android.view.WindowManager;

public class DensityUtil
{
  public static final int HVGA = 1;
  public static final int OTHER_DENSITY = 2;
  public static final int WVGA;

  public static int dip2px(Context paramContext, float paramFloat)
  {
    return (int)(0.5F + paramFloat * paramContext.getResources().getDisplayMetrics().density);
  }

  public static int getDensity(Activity paramActivity)
  {
    DisplayMetrics localDisplayMetrics = new DisplayMetrics();
    paramActivity.getWindowManager().getDefaultDisplay().getMetrics(localDisplayMetrics);
    float f = localDisplayMetrics.density;
    if (f == 1.0D)
      return 1;
    if (f == 1.5D)
      return 0;
    return 2;
  }

  public static int getScreenHeight(Activity paramActivity)
  {
    return paramActivity.getWindowManager().getDefaultDisplay().getHeight();
  }

  public static int getScreenWidth(Activity paramActivity)
  {
    return paramActivity.getWindowManager().getDefaultDisplay().getWidth();
  }
}

/* Location:           H:\360云盘\lewa_explorer_3.0\bin\FileApp_orig_dex2jar.jar
 * Qualified Name:     cn.cheln.support.ui.DensityUtil
 * JD-Core Version:    0.5.2
 */